<template>
  <div class="detail">
    <van-nav-bar
        title="酒店详情"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <details-head :housePics="houseInfo.mainPart?.topModule?.housePicture?.housePics" v-if="houseInfo.mainPart?.topModule"></details-head>
    <details-content-all :houseInfo="houseInfo" v-if="Object.keys(houseInfo).length"></details-content-all>
  </div>
</template>

<script setup>
import {ref} from "vue"
import {useRoute,useRouter} from "vue-router"
import newaxios from "@/service/request"
import DetailsHead from "./kids/DetailsHead.vue"
import DetailsContentAll from "./kids/DetailsContentAll.vue"


const router = useRouter()
const route = useRoute({})

const houseId= route.params.id
const houseInfo = ref({})
async function getHouseInfo(){
    const {data} =  await newaxios.get("/detail/infos",{params:{houseId}})
    houseInfo.value = data
}
getHouseInfo()

function onClickLeft(){
    router.back()
}
</script>

<style lang="less" scoped>

</style>